﻿using System.Collections.Generic;
using WikiPlex.Compilation;
using WikiPlex.Compilation.Macros;

namespace WikiMaml.Macros
{
    /// <summary>
    /// This macro will contain the introduction.
    /// </summary>
    public class IntroductionMacro : IMacro
    {
        /// <summary>
        /// Gets the id of the macro.
        /// </summary>
        public string Id
        {
            get { return "Introduction"; }
        }

        /// <summary>
        /// Gets the list of rules for the macro.
        /// </summary>
        public IList<MacroRule> Rules
        {
            get
            {
                return new List<MacroRule>
                           {
                               new MacroRule(
                                   @"(?si)(\{intro:outline}).*?(\{intro})",
                                   new Dictionary<int, string>
                                       {
                                           {1, MamlScopeName.IntroductionWithOutlineBegin},
                                           {2, MamlScopeName.IntroductionEnd}
                                       }),
                               new MacroRule(
                                   @"(?si)(\{intro}).*?(\{intro})",
                                   new Dictionary<int, string>
                                       {
                                           {1, MamlScopeName.IntroductionBegin},
                                           {2, MamlScopeName.IntroductionEnd}
                                       })
                           };
            }
        }
    }
}